/*
 *  Written by glory. 
 */

var app = angular.module('app', ['ui.router', 'myHome']);

app.run(function ($rootScope, $state, $stateParams) {
    $rootScope.$state = $state;
    $rootScope.$stateParams = $stateParams;
});

app.config(function ($stateProvider, $urlRouterProvider) {
    $stateProvider
        .state('home', {
            url: '/home'
            , templateUrl: './tpl/home.html'
        })
        .state('type', {
            url: '/type'
            , templateUrl: './tpl/type.html'
        })
        .state('register', {
            url: '/register'
            , templateUrl: './tpl/register'
        })
        .state('login', {
            url: '/login'
            , templateUrl: './tpl/login.html'
        })
        .state('user', {
            url: '/user'
            , templateUrl: './tpl/user.html'
        })
        .state('cart', {
            url: '/cart'
            , templateUrl: './tpl/cart.html'
        });

    $urlRouterProvider.otherwise('/home');
});